#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

 struct student
{
    int usual_mark;
    int exam_mark;
    double overall_mark;
};

int main()
{
    FILE* in = fopen("\\data.txt", "r");
    FILE* out = fopen("\\T_data.txt","w");

    struct student stu[100];
    int i = 0;
    if (in == NULL)
    {
        printf("error\n");
        exit(0);
    }
    if (out == NULL)
    {
        printf("error\n");
        exit(0);
    }
    while (!feof(in))
    {
        fscanf(in,"%d %d", &stu[i].usual_mark, &stu[i].exam_mark);
        i++;
    }
    for (int j = 0; j < i; j++)
    {
        stu[j].overall_mark = stu[j].usual_mark * 0.2 + stu[j].exam_mark * 0.8;
        printf("%.2lf\n", stu[j].overall_mark);
        fprintf(out,"%.2lf\n", stu[j].overall_mark);
    }
}